﻿
<template>
<div class="card-fill layout-padding">
<el-card shadow="hover" class="layout-padding-auto" >
  <el-form ref="formRefDqOrder" :model="stateDqOrder.vmModel" label-width="100px">
    <el-row>
      
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_factoryCode_FormItem" prop="Entity.factoryCode" label="工厂编号">
            <el-input v-model="stateDqOrder.vmModel.Entity.factoryCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_lineCode_FormItem" prop="Entity.lineCode" label="产线编号">
            <el-input v-model="stateDqOrder.vmModel.Entity.lineCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_lineName_FormItem" prop="Entity.lineName" label="产线名称">
            <el-input v-model="stateDqOrder.vmModel.Entity.lineName" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_scheduleNumber_FormItem" prop="Entity.scheduleNumber" label="主排程号">
            <el-input v-model="stateDqOrder.vmModel.Entity.scheduleNumber" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_startTime_FormItem" prop="Entity.startTime" label="计划开始时间">
            <el-date-picker v-model="stateDqOrder.vmModel.Entity.startTime" disabled clearable></el-date-picker>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_endTime_FormItem" prop="Entity.endTime" label="计划结束时间">
            <el-date-picker v-model="stateDqOrder.vmModel.Entity.endTime" disabled clearable></el-date-picker>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_orderCode_FormItem" prop="Entity.orderCode" label="工单编码">
            <el-input v-model="stateDqOrder.vmModel.Entity.orderCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_orderQty_FormItem" prop="Entity.orderQty" label="工单数量">
            <el-input v-model="stateDqOrder.vmModel.Entity.orderQty" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_orderType_FormItem" prop="Entity.orderType" label="工单类型">
            <el-input v-model="stateDqOrder.vmModel.Entity.orderType" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_orderStatus_FormItem" prop="Entity.orderStatus" label="工单状态">
            <el-input v-model="stateDqOrder.vmModel.Entity.orderStatus" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_orderStateCode_FormItem" prop="Entity.orderStateCode" label="工单状态编码">
            <el-input v-model="stateDqOrder.vmModel.Entity.orderStateCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_orderStartTime_FormItem" prop="Entity.orderStartTime" label="工单开始时间">
            <el-date-picker v-model="stateDqOrder.vmModel.Entity.orderStartTime" disabled clearable></el-date-picker>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_orderEndTime_FormItem" prop="Entity.orderEndTime" label="工单结束时间时间">
            <el-date-picker v-model="stateDqOrder.vmModel.Entity.orderEndTime" disabled clearable></el-date-picker>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_scheduleCode_FormItem" prop="Entity.scheduleCode" label="排程编码">
            <el-input v-model="stateDqOrder.vmModel.Entity.scheduleCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_scheduleQty_FormItem" prop="Entity.scheduleQty" label="排程数量">
            <el-input v-model="stateDqOrder.vmModel.Entity.scheduleQty" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_scheduleStatus_FormItem" prop="Entity.scheduleStatus" label="排程状态">
            <el-input v-model="stateDqOrder.vmModel.Entity.scheduleStatus" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_scheduleStateCode_FormItem" prop="Entity.scheduleStateCode" label="排程状态编码">
            <el-input v-model="stateDqOrder.vmModel.Entity.scheduleStateCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_scheduleStartTime_FormItem" prop="Entity.scheduleStartTime" label="排程开始时间">
            <el-date-picker v-model="stateDqOrder.vmModel.Entity.scheduleStartTime" disabled clearable></el-date-picker>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_scheduleEndTime_FormItem" prop="Entity.scheduleEndTime" label="排程结束时间">
            <el-date-picker v-model="stateDqOrder.vmModel.Entity.scheduleEndTime" disabled clearable></el-date-picker>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_productCode_FormItem" prop="Entity.productCode" label="产品编码">
            <el-input v-model="stateDqOrder.vmModel.Entity.productCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_productName_FormItem" prop="Entity.productName" label="产品名称">
            <el-input v-model="stateDqOrder.vmModel.Entity.productName" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_productVersion_FormItem" prop="Entity.productVersion" label="产品版本">
            <el-input v-model="stateDqOrder.vmModel.Entity.productVersion" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_materialCode_FormItem" prop="Entity.materialCode" label="物料编码">
            <el-input v-model="stateDqOrder.vmModel.Entity.materialCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_materialName_FormItem" prop="Entity.materialName" label="物料名称">
            <el-input v-model="stateDqOrder.vmModel.Entity.materialName" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_materialVersion_FormItem" prop="Entity.materialVersion" label="物料版本">
            <el-input v-model="stateDqOrder.vmModel.Entity.materialVersion" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_routeCode_FormItem" prop="Entity.routeCode" label="工艺编号">
            <el-input v-model="stateDqOrder.vmModel.Entity.routeCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_routeName_FormItem" prop="Entity.routeName" label="工艺名称">
            <el-input v-model="stateDqOrder.vmModel.Entity.routeName" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_routeVersion_FormItem" prop="Entity.routeVersion" label="工艺路线版本">
            <el-input v-model="stateDqOrder.vmModel.Entity.routeVersion" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_priority_FormItem" prop="Entity.priority" label="priority" :rules="[{ required: true, message:'priority为必填项',trigger:'blur'}]">
            <el-input-number v-model="stateDqOrder.vmModel.Entity.priority" disabled clearable></el-input-number>
        </el-form-item>
    </el-col>
    </el-row>

    <div style="text-align:right;">
      <WtmButton @click="onCloseDqOrder"  type="primary" :button-text="$t('message._system.common.vm.cancel')" style="margin-top:15px;"/>
    </div>
  </el-form>

</el-card>
</div>
</template>


<script setup lang="ts" name="message._system.common.vm.detail;false">
import {  ElMessageBox, ElMessage } from 'element-plus';
import { defineAsyncComponent,reactive, ref, getCurrentInstance, onMounted, nextTick } from 'vue';
import { DqOrderApi } from '/@/api/baseinformation/DqOrder';
import other from '/@/utils/other';
import fileApi from '/@/api/file';
import { useRouter } from "vue-router";
const ci = getCurrentInstance() as any;

// 定义变量内容
const formRefDqOrder = ref();
const stateDqOrder = reactive({
      vmModel: {
	  Entity:{
      			ID: null,
			factoryCode: null,
			lineCode: null,
			lineName: null,
			scheduleNumber: null,
			startTime: null,
			endTime: null,
			orderCode: null,
			orderQty: null,
			orderType: null,
			orderStatus: null,
			orderStateCode: null,
			orderStartTime: null,
			orderEndTime: null,
			scheduleCode: null,
			scheduleQty: null,
			scheduleStatus: null,
			scheduleStateCode: null,
			scheduleStartTime: null,
			scheduleEndTime: null,
			productCode: null,
			productName: null,
			productVersion: null,
			materialCode: null,
			materialName: null,
			materialVersion: null,
			routeCode: null,
			routeName: null,
			routeVersion: null,
			priority: null,

      },
      
	},
    
     
});

// 取消
const onCloseDqOrder = () => {
    closeDialog();
};


// 页面加载时
onMounted(() => {
    
     if (ci.attrs["wtmdata"]) {
		stateDqOrder.vmModel.Entity.ID = ci.attrs["wtmdata"].ID;
	}
	else if (useRouter().currentRoute.value.query.id) {
		stateDqOrder.vmModel.Entity.ID = useRouter().currentRoute.value.query.id as any;
	}
	DqOrderApi().get(stateDqOrder.vmModel.Entity.ID ?? "").then((data: any) => other.setValue(stateDqOrder.vmModel, data));
});

// 定义子组件向父组件传值/事件
const emit = defineEmits(['refresh','closeDialog']);
// 关闭弹窗
const closeDialog = () => {
    emit('closeDialog');
};
// 暴露变量
defineExpose({

});
</script>

<style scoped lang="scss">

</style>

